<template>
  <div>
    <h2>App组件</h2>
    <p>使用数据项：{{ $store.state.user.age }}</p>
    <p>使用方法：{{ $store.getters['user/aa'] }}</p>
    <button @click="$store.commit('user/updateAge', 2)">让age+2</button>
    <button @click="$store.dispatch('user/updateAgeAfter3s', 1)">
      3秒后+1
    </button>
    <my-test></my-test>
  </div>
</template>

<script>
import MyTest from './components/MyTest.vue'
export default {
  components: { MyTest },
  name: 'MyApp'
}
</script>

<style lang="less" scoped></style>
